package jtk.project4.fleet.field;
/* 
 * Author               : Ezhar Ferbi Subyadi
 * Date Created         : 4-April-2011 
 * Date Modified        : 6-April-2011 
 * Version              : 1.1 
 * */ 
import java.awt.Color;
import java.awt.Dimension;



import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.MemoField;
import nl.coderight.jazz.form.field.SelectField;
import nl.coderight.jazz.form.field.SpinnerField;
import nl.coderight.jazz.form.field.TextField;
import nl.coderight.jazz.form.field.button.MenuButton;
import nl.coderight.jazz.form.field.button.PushButton;


public class AdjustInventoryForPartField extends GroupControl{
private ComboField partNumberField ;
private TextField nameField;
private CalendarControl dateField;
private SpinnerField quantityField;
private TextField unitCostField;
private TextField extendedCostField;
private SelectField warehouseField;
private SelectField vendorField;
private SelectField typeField;
private MemoField reasonField;
private PushButton tambah;


public AdjustInventoryForPartField(String bindID){
	setTitle("header.Adjust Inventory For Part");
	setBindID(bindID);
	createFields();
	createLayout();
	
}
private void createFields(){
	partNumberField = new ComboField("domains","domain");
	partNumberField.setPreferredSize(new Dimension(235, 22));
	nameField = new TextField("name");
	nameField.setEditable(false);
	nameField.setRequired(true);
	nameField.setPreferredSize(new Dimension(235, 22));
	dateField = new CalendarControl("date", 22);
	dateField.showYearSpinner(true);
	dateField.setPreferredSize(new Dimension(100, 22));
	quantityField = new SpinnerField("1","1");
	quantityField.setPreferredSize(new Dimension(100, 22));
	quantityField.setDisplayID("1");
	unitCostField =new TextField("Unit");
	unitCostField.setPreferredSize(new Dimension(100, 22));
	extendedCostField = new TextField("extended");
	extendedCostField.setPreferredSize(new Dimension(100, 22));
	extendedCostField.setEditable(false);
	warehouseField = new SelectField("", "");
	warehouseField.setEnabled(false);
	warehouseField.setPreferredSize(new Dimension(215, 22));
	vendorField = new SelectField("", "");
	vendorField.setPreferredSize(new Dimension(215,22));
	tambah =new PushButton("...");
	tambah.setPreferredSize(new Dimension(20, 22));
	typeField = new SelectField("", "");
	typeField.setPreferredSize(new Dimension(100, 22));
	reasonField = new MemoField();
	reasonField.setRows(5);
}
private void createLayout() {
	setLayout(new FormLayout())
	.addLabel("label.part Number:").addField(partNumberField)
	.addRow()
	.addLabel("label.name:").addField(nameField)
	.addRow()
	.addLabel("label.date:").addField(dateField)
	.addRow()
	.addLabel("label.quantity:").addField(quantityField)
	.addRow()
	.addLabel("label.Unit Cost:").addField(unitCostField)
	.addRow()
	.addLabel("label.Extended Cost:").addField(extendedCostField)
	.addRow()
	.addLabel("label.Warhouse:").addField(warehouseField)
	.addRow()
	.addLabel("label.Vendor:").addField(vendorField)
	.addField(tambah)
	.addRow()
	.addLabel("label.Type:").addField(typeField)
	.addRow()
	.addLabel("label.Reason:").addField(reasonField);
	

	
}
}
